<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>

<body>
    <div id="app">
        <img v-bind:src="imgSrc" alt="">
        <img :src="imgSrc" alt="">
        <input type="text" :value="value">
        <button v-on:click="log1">按钮</button>
        <button @click="log2">按钮2</button>
        <button @click="log3">按钮3</button>
    </div>
    img
</body>
<script>
    let vm = new Vue({
        el: '#app',
        data: {
            imgSrc: './下载.jpg',
            value: '我是输入框的值',
        },
        methods: {
            log1() {
                console.log(1);
            },
            log2() {
                console.log(2);

            },
            log3() {
                if (this.imgSrc == '') {
                    this.imgSrc = './下载.jpg';
                } else {
                    this.imgSrc = '';
                }
            }
        }
    })
</script>

</html>